<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <title>编码操作</title>
</head>
<body>

  <script>

    // 1.编码操作
    var str = "柳岩";

    var enStr = encodeURI(str);

    console.info(enStr);


    // 2.解码操作
    var deStr = decodeURI(enStr);

    console.info(deStr);

  </script>

</body>
</html>